from selenium import webdriver
class Base():
    _base_url = ""
    def __init__(self,driver:webdriver=None):
        self._driver = ""
        #如果是none直接调用driver ,无需重复进行驱动的调用
        if driver is None:
            self._driver = webdriver.Chrome()
        # 判断第一次driver 进行初始化形成none
        else:
            self._driver = driver
        if self._base_url != " ":
            self._driver.get(self._base_url)
            self._driver.maximize_window()


    def find(self,by,locator):
        return self._driver.find_element(by,locator)
